<?

//$curdir = "f:/projects/UT\ World/galaxietool/";

function array2str($array, $etc="\t") {
	$str = "Array{\n";
	foreach($array as $key => $value) {
		if(!is_array($value)) {
			$str .= $etc . "$key => $value" . "\n";
		} else {
			$str .= $etc . "$key => " . array2str($value, $etc."\t") . "\n";
		}
	}
	$str .= $etc . "}";
	return $str;
}

function _debug($params) {
	$curdir = dirname(__FILE__)."/";
	$logfile = $curdir . "debug.log";
	
	if(is_array($params))
		$params = array2str($params);
	else if(is_bool($params)) {
		$params = "Boolean[" . ($params ? 'true' : 'false') . "]";
	}
	$fh = fopen($logfile, "a+");
	fwrite($fh, $params);
	fwrite($fh, "\n");
	fclose($fh);
}

//_debug("test");

?>